package com.ly.system.controller.user;

import com.ly.common.core.controller.BaseController;
import com.ly.common.core.domain.R;
import com.ly.common.core.domain.TableDataInfo;
import com.ly.system.domain.exam.dto.ExamAddDTO;
import com.ly.system.domain.exam.dto.ExamQueryDTO;
import com.ly.system.domain.user.dto.UserDTO;
import com.ly.system.domain.user.dto.UserQueryDTO;
import com.ly.system.service.exam.IExamService;
import com.ly.system.service.user.IUserService;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
//与管理员相关
@RequestMapping("/user")
public class UserController extends BaseController {

    @Autowired
    private IUserService userService;

    //user/list
    @GetMapping("/list")
    public TableDataInfo list(UserQueryDTO userQueryDTO){
        return getTableDataInfo(userService.list(userQueryDTO));
    }
    //user/updateStatus
    @PutMapping("/updateStatus")
    //todo 拉黑:限制用户操作,解禁:放开对用户的限制
    public R<Void> updateStatus(@RequestBody UserDTO userDTO){
        return toR(userService.updateStatus(userDTO));
    }

}
